home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 7 / Amiga Format AFCD07 (Dec 1996, Issue 91).iso / serious / shareware / programming / aros / exec / doio.c < prev    next >
C/C++ Source or Header  |  1996-09-12  |  2KB  |  78 lines

  1. /*
  2.     (C) 1995-96 AROS - The Amiga Replacement OS
  3.     $Id: doio.c,v 1.4 1996/08/13 13:56:01 digulla Exp $
  4.     $Log: doio.c,v $
  5.     Revision 1.4  1996/08/13 13:56:01  digulla
  6.     Replaced __AROS_LA by __AROS_LHA
  7.     Replaced some __AROS_LH*I by __AROS_LH*
  8.     Sorted and added includes
  9.  
  10.     Revision 1.3  1996/08/01 17:41:09  digulla
  11.     Added standard header for all files
  12.  
  13.     Desc:
  14.     Lang: english
  15. */
  16. #include <exec/execbase.h>
  17. #include <exec/io.h>
  18. #include <aros/libcall.h>
  19.  
  20. /*****************************************************************************
  21.  
  22.     NAME */
  23.     #include <clib/exec_protos.h>
  24.  
  25.     __AROS_LH1(BYTE, DoIO,
  26.  
  27. /*  SYNOPSIS */
  28.     __AROS_LHA(struct IORequest *, iORequest, A1),
  29.  
  30. /*  LOCATION */
  31.     struct ExecBase *, SysBase, 76, Exec)
  32.  
  33. /*  FUNCTION
  34.     Start an I/O request by calling the devices's BeginIO() vector.
  35.     It waits until the request is complete.
  36.  
  37.     INPUTS
  38.     iORequest - Pointer to iorequest structure.
  39.  
  40.     RESULT
  41.  
  42.     NOTES
  43.  
  44.     EXAMPLE
  45.  
  46.     BUGS
  47.  
  48.     SEE ALSO
  49.     OpenDevice(), CloseDevice(), DoIO(), SendIO(), AbortIO(), WaitIO()
  50.  
  51.     INTERNALS
  52.  
  53.     HISTORY
  54.  
  55. ******************************************************************************/
  56. {
  57.     __AROS_FUNC_INIT
  58.  
  59.     /*
  60.     Prepare the message. Tell the device that it is OK to wait in the
  61.     BeginIO() call by setting the quick bit.
  62.     */
  63.     iORequest->io_Flags=IOF_QUICK;
  64.     iORequest->io_Message.mn_Node.ln_Type=0;
  65.  
  66.     /* Call BeginIO() vector */
  67.     __AROS_LVO_CALL1(void,5,iORequest->io_Device,iORequest,A1);
  68.  
  69.     /* It the quick flag is cleared it wasn't done quick. Wait for completion. */
  70.     if(!(iORequest->io_Flags&IOF_QUICK))
  71.     WaitIO(iORequest);
  72.  
  73.     /* All done. Get returncode. */
  74.     return iORequest->io_Error;
  75.     __AROS_FUNC_EXIT
  76. } /* DoIO */
  77.  
  78.